package com.cms.work.core.service;

import java.util.List;

import org.springframework.stereotype.Service;

import tk.mybatis.mapper.entity.Example;

import com.github.pagehelper.PageInfo;

/**
 * 业务层通用接口
 */
@Service
public interface BaseService<T, PK> {

    T selectByPrimaryKey(PK key);
    
    List<T> selectByCondition(T entity);
    
    List<T> selectByCondition(Example example);
    
    List<T> selectAll();
    
    int insert(T entity);
    
    int insertSelective(T entity);

    int update(T entity);

    int updateSelective(T entity);
    
    int deleteByPrimaryKey(PK key);
    
    void save(T entity);
    
    PageInfo<T> selectPage(int pageNum,int pageSize);
    
    PageInfo<T> selectPage(int pageNum,int pageSize,T entity);
    
    PageInfo<T> fuzzySelectPage(int pageNum, int pageSize, String orderBy, T entity);
    
    PageInfo<T> selectPage(int pageNum,int pageSize,String orderBy, T entity);
    
    PageInfo<T> selectPage(PageInfo<T> tPageInfo);
    //TODO 其他...
}
